#!/bin/bash

#必须是root用户才可以执行
if [ $UID -ne 0 ]; then
    echo "Superuser privileges are required to run this script."
    echo "e.g. \"sudo $0\""
    exit 1
fi

# 安装禅道
echo "starting to install zentao"
cd $resourcebasepath
cd zentao
tar -zxvf ZenTaoPMS.9.6.1.zbox_64.tar.gz -C /opt

cd /opt/zbox/
# 设置禅道端口
./zbox -ap 8089
# 启动禅道
./zbox start
# 开放8089端口
firewall-cmd --zone=public --add-port=8089/tcp --permanent
firewall-cmd --reload